#ifndef APPLICATIONFACTORY_H
#define APPLICATIONFACTORY_H

#include "QObject"

class MainWindow;
class SequenceFunctionFactory;
class ScriptFunctionFactory;

class SequenceRunner;
class SequenceModel;
class ScriptEngine;
class AudioVideoAutomation;
class PictureAutomation;
class ShowManager;

class IF_LightEngineInterface;



/**
 * Create all objects that have a lifetime as long as
 * the application itself.
 */
class ApplicationFactory : public QObject
{
   Q_OBJECT
public:
   ApplicationFactory();
   ~ApplicationFactory();

   MainWindow *mainWindow() {
      return m_mainWindow;
   }

private:
   MainWindow *m_mainWindow;
   SequenceFunctionFactory *m_sequenceFactory;
   ScriptFunctionFactory *m_scriptFactory;

private:
   void createSequenceActions(SequenceRunner* sequenceRunner);
   void wireSequenceFunction(SequenceRunner* sequenceRunner, SequenceModel *sequenceModel,
                              AudioVideoAutomation *avAutomation, PictureAutomation * picAutomation,
                              IF_LightEngineInterface *lightEngine);

   void wireScriptFunction( ScriptEngine* scriptEngine, AudioVideoAutomation *avAutomation,
                            PictureAutomation * picAutomation,
                            IF_LightEngineInterface *lightEngine);
   void wireShowFunction(ShowManager *show, ScriptEngine *scriptEngine);
};

#endif // APPLICATIONFACTORY_H
